DESCRIPTION = "Linux kernel for Phytium"
SECTION = "kernel"
LICENSE = "GPLv2"

PROVIDES += "virtual/kernel"

KCONFIG_MODE="--alldefconfig"

KSRC ?= "git://gitee.com/ourbmc/linux.git;protocol=https;branch=${KBRANCH}"
SRC_URI = "${KSRC}"
SRC_URI += "file://defconfig"

require recipes-kernel/linux/linux-yocto.inc

LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"

# There are currently no additional versions available.
LINUX_VERSION_EXTENSION ?= ""

PV = "${LINUX_VERSION}+git${SRCPV}"

S = "${WORKDIR}/git"

# Selection of configuration for different kernel versions.
python() {
    linux_version = d.getVar('LINUX_VERSION')

    if len(linux_version) > 0 :
        machine_overrides = d.getVar('MACHINEOVERRIDES')
        kernel_override = ":phytium-" + linux_version
        new_overrides = machine_overrides + kernel_override

        d.setVar('MACHINEOVERRIDES', new_overrides)
}
